package bil.imagem;

import java.awt.Component;
import java.util.Vector;
import javax.swing.JProgressBar;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

/**
 *
 * @author Eduardo Folly
 */
public class ImagemCellRendererBar extends DefaultTableCellRenderer {

    private JProgressBar bar = new JProgressBar();

    public ImagemCellRendererBar() {
        super();
        bar.setStringPainted(true);
    }

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value,
            boolean isSelected, boolean hasFocus, int row, int column) {

        Vector<Integer> vec = (Vector) value;

        bar.setMaximum(vec.get(1));
        bar.setValue(vec.get(0));
        return bar;

    }
}
